/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package lego.impl;

import lego.Actioner;
import lego.ActionerPort;
import lego.LegoPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Actioner Port</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link lego.impl.ActionerPortImpl#getActioner <em>Actioner</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ActionerPortImpl extends EObjectImpl implements ActionerPort {
	/**
	 * The cached value of the '{@link #getActioner() <em>Actioner</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getActioner()
	 * @generated
	 * @ordered
	 */
	protected Actioner actioner;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected ActionerPortImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return LegoPackage.Literals.ACTIONER_PORT;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Actioner getActioner() {
		if (actioner != null && actioner.eIsProxy()) {
			InternalEObject oldActioner = (InternalEObject)actioner;
			actioner = (Actioner)eResolveProxy(oldActioner);
			if (actioner != oldActioner) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, LegoPackage.ACTIONER_PORT__ACTIONER, oldActioner, actioner));
			}
		}
		return actioner;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Actioner basicGetActioner() {
		return actioner;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setActioner(Actioner newActioner) {
		Actioner oldActioner = actioner;
		actioner = newActioner;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, LegoPackage.ACTIONER_PORT__ACTIONER, oldActioner, actioner));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case LegoPackage.ACTIONER_PORT__ACTIONER:
				if (resolve) return getActioner();
				return basicGetActioner();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case LegoPackage.ACTIONER_PORT__ACTIONER:
				setActioner((Actioner)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case LegoPackage.ACTIONER_PORT__ACTIONER:
				setActioner((Actioner)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case LegoPackage.ACTIONER_PORT__ACTIONER:
				return actioner != null;
		}
		return super.eIsSet(featureID);
	}

} //ActionerPortImpl
